<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			#div1{
				width:100px;
				height:100px;
				border:1px solid red;
			}
		</style>
	</head>
	<body>
		<script>
		//页面加载完之后再执行
			window.onload = function(){
				//1.通过id获取
				var oDiv = document.getElementById('div1');
				console.log(oDiv);
				
//				get:获得
//				Element:元素
//				By:通过
//				Id:id
				//2.通过class获取
				var oEles = document.getElementsByClassName('c1');//获得的是一个元素集合，可以遍历
				console.log(oEles);
				for(var i=0;i<oEles.length;i++){
					console.log(oEles[i]);
				}
				//3.通过标签名获取
				var lis = document.getElementsByTagName('li');
				console.log(lis);
				
				
				
				
				
				
				
				
			}
			
		</script>
		<div id="div1">123</div>
		<ul>
			<li class="c1">11111</li>
			<li class="c1">22222</li>
			<li>33333</li>
			<li>44444</li>
			<li class="c1">55555</li>
			<li>66666</li>
		</ul>
		<div class="c1"></div>
	</body>
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
</html>
